<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="http://struts.apache.org/tags-html-el" prefix="html-el" %>
<%@taglib uri="http://struts.apache.org/tags-bean-el" prefix="bean-el" %>
<%@taglib uri="http://struts.apache.org/tags-logic-el" prefix="logic-el" %>
<%@taglib uri="/WEB-INF/tld/application.tld" prefix="app" %>

<html-el:form action="/login.do?method=login">
	<div style="width: 100%; height: 100%">
		<div data-dojo-type="dijit.TitlePane" title="Login" style="width:250px;height:200px;left:50%;top:50%;position:absolute;margin-left:-125px;margin-top:-100px">
			<table cellpadding="1" cellspacing="4" width="100%"> 
				<tr>
					<td width="60" align="left">Usuário:</td>
					<td align="left"><html-el:text property="usuario" styleId="usuario" size="15" maxlength="25" title="Usuário"/></td>
				</tr>
				<tr>
					<td align="left">Senha:</td>
					<td align="left"><html-el:password property="senha" styleId="senha" size="15" maxlength="10" title="Senha"/></td>
				</tr>
				<tr>
					<td colspan="2">
						<table width="100%">
							<tr>
								<td height="10"></td>
							</tr>
							<tr>
								<td align="right"><html-el:button property="btnLogin" styleClass="button" value="Confirmar" onclick="confirmar()"/></td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</div>
	</div>
</html-el:form>
<script language="javascript">

	dojo.addOnLoad(function() {
		onFocus("usuario");
	});

	function confirmar() {
		if(!mandatoryField('usuario'))
			return false;
			
		if(!mandatoryField('senha'))
			return false;
		
		document.forms[0].action = "login.do?method=login";
		document.forms[0].submit();
	}
</script>
